// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import {Button} from 'mint-ui'
import 'mint-ui/lib/style.css'

import './mock/mockServer' // 只需要和css一样打包运行时候加载进项目即可
import './fiters' // 加载过滤器

// 全局路由拦截，若访问个人中心页则跳转至个人页
router.beforeEach((to, from, next) => {
  if (to.path === '/userInfo') {
    next('/personal')
  }
  next()
})

Vue.component(Button.name, Button) // 注册全局组件标签

/* eslint-disable no-new */
new Vue({
  el: '#app',
  components: { App },
  template: '<App/>',
  router,
  store
})
